package com.k.designpattern.creational.builder.beanbuilder;

/**
 * @author k
 */
public class StudentBuilder {

    /**
     * Fields
     */
    private Long id;
    private String name;
    private String address;

    /**
     * constructor
     */
    public StudentBuilder() {
    }

    public StudentBuilder setId(Long id) {
        this.id = id;
        return this;
    }

    public StudentBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public StudentBuilder setAddress(String address) {
        this.address = address;
        return this;
    }

    public Student build() {
        return new Student(this.id, this.name, this.address);
    }

    public static StudentBuilder create() {
        return new StudentBuilder();
    }
}
